import request from '@/plugins/axios'

export function fetchList(query) {
  return request({
    url: '/api/budgettemplate/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/api/budgettemplate',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/api/budgettemplate/' + id,
    method: 'get'
  })
}

export function getItem(id) {
    return request({
        url: '/api/budgettemplate/getItem/' + id,
        method: 'get'
    })
}

export function getItem2(id) {
    return request({
        url: '/api/budgettemplate/getItem2/' + id,
        method: 'get'
    })
}

export function delObj(id) {
  return request({
    url: '/api/budgettemplate/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/api/budgettemplate',
    method: 'put',
    data: obj
  })
}

export function saveTemplateData(obj) {
    return request({
        url: '/api/budgettemplate/saveTemplateData',
        method: 'put',
        data: obj
    })
}

export function updateTemplateData(obj) {
    return request({
        url: '/api/budgettemplate/updateTemplateData',
        method: 'put',
        data: obj
    })
}

export function saveOrUpdateItem(obj) {
    return request({
        url: '/api/budgettemplate/saveOrUpdateItem',
        method: 'put',
        data: obj
    })
}
